package com.cxhit.oss.aliyun;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

/**
 * @desc knife4j api 文档配置
 * @author wanggang
 * @time 2023/3/31 14:10
 */
@Configuration
@EnableSwagger2WebMvc
public class Knife4jConfig {

    @Bean
    public Docket studentApi() {
        Docket docket=new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(new ApiInfoBuilder()
                        .title("aliyun-oss-api")
                        .description("aliyun-oss-api")
                        .termsOfServiceUrl("http://www.unouno.mx/")
                        .contact("service@unouno.mx")
                        .version("2.0")
                        .build())
                //分组名称
                .groupName("aliyun-oss-api")
                .select()
                //这里指定Controller扫描包路径
                .apis(RequestHandlerSelectors.basePackage("com.cxhit.oss.aliyun"))
                .paths(PathSelectors.any())
                .build();

        return docket;

    }

}
